package com.wlhse.dao;

import com.wlhse.dto.HSEAuditGroupDto;
import com.wlhse.dto.outDto.CompanyOutDto;
import com.wlhse.entity.CompanyPojo;
import com.wlhse.util.R;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface CompanyDao {
    List<CompanyPojo> queryCompany();

    List<CompanyPojo> querySamleLevelCompany(@Param("code") String code);

    Integer updateCompanyOrder(@Param("order") Integer order,@Param("code") String code);

    String queryByCompanyName(String companyName);

    //同一个companyName可能对应多个companyCode
    List<String> queryCompanyCodes(String companyName);

    String queryByCompanyCode(String companyCode);
    //List<HSEAuditGroupDto> cascadingQueryByYear(@Param("year") String year);
   // List<HSEAuditGroupDto> QueryByYearAndRound(@Param("year") String year,@Param("round") String round);
    List<HSEAuditGroupDto> QueryByAll(@Param("year") String year,@Param("round")String round,@Param("auditGroupName")String auditGroupName);


    int queryMaxLenth();

    List<CompanyOutDto> getListCompanyOutSonDto(@Param("length") int length, @Param("name") String name);

    String getCompanyOutDto(String companyCode);

    String getCompanyCode(@Param("companyCode") String companyCode, @Param("name") String name);

    int getNameCount(@Param("name") String name);

    List<CompanyPojo> queryContractingCompany(@Param("name") String name);

    int getContractingCompanyCount(@Param("name") String name);

    String getParentCompanyByCode(@Param("companyCode") String companyCode);

    String getBasicCompanyByCode(@Param("companyCode") String companyCode);

    String likeQueryByCompanyName(@Param("companyName") String companyName,@Param("companyCode") String companyCode);

    Integer updateCompanyName1(@Param("name") String name,@Param("code") String code);
    Integer updateCompanyName2(@Param("name") String name,@Param("code") String code);
    Integer updateCompanyName3(@Param("name") String name,@Param("code") String code);

    List<CompanyPojo> queryCompanyList(List<String> companyCodes);
    Integer checkChangedCompany(List<String> companyCodes);
    Integer updateEmployeeComCode(@Param("oldCode") String oldCode,@Param("newCode") String newCode);
    Integer updateSupervisionAreaComCode(@Param("oldCode") String oldCode,@Param("newCode") String newCode);
    Integer updateSupervisionDetail2ComCode(@Param("oldCode") String oldCode,@Param("newCode") String newCode);
    Integer updateSupervisionScopeComCode(@Param("oldCode") String oldCode,@Param("newCode") String newCode);

}
